//
//  MyMainViewController.m
//  fruitsbuy3
//
//  Created by sgone-2 on 15/7/28.
//  Copyright (c) 2015年 sgone. All rights reserved.
//

#import "MyMainViewController.h"
#import "CustomViewController.h"
#import "LoginViewController.h"
#import "DataSingleton.h"
@interface MyMainViewController ()

@end

@implementation MyMainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    

    
    
}



//只能在这里显示
-(void)viewDidAppear:(BOOL)animated
{
    
    [super viewDidAppear:animated];
    
    
    DataSingleton *dh = [DataSingleton sharedDataSingleton];
    
    
//    NSLog(@"yyyyyyyy %@",dh.phone);
    
    if (!dh.phone || dh.phone.length == 0    ){
        LoginViewController *login = [[LoginViewController alloc]init];
        UINavigationController *navi = [[UINavigationController alloc]initWithRootViewController:login];
        navi.navigationBar.hidden = YES;
//        navi.navigationBar.tintColor = THEME_COLOR;
        //  [self presentModalViewController:navi animated:YES];
        
        [self presentViewController:navi animated:NO completion:nil];
        
        
    }else
    {
        
        CustomViewController *cus = [[CustomViewController alloc]init];
        
        [self presentViewController:cus animated:NO completion:nil];
        
    }



    

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
